package com.system.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class PostgreSQL {

	public static Connection conexao() {

		Connection con = null;

		try {

			Class.forName("org.postgresql.Driver");

			con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/controledev", "postgres", "postgres");

			return con;

		} catch (Exception e) {
			e.printStackTrace();

			return null;
		}
	}

	public static void close(Connection c, Statement st, ResultSet rs) {
		try {
			c.close();
			st.close();
			rs.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}